package openClose;

/**
 * @Author: 蔡翔
 * @Date: 2019/11/7 15:10
 * @Version 1.0
 */
public class Test {
    public static void main(String[] args) {
        //ICourse javaCourse = new JavaCourse(96,"java从零开发",3456d);
        //ICourse 是由哪个 new Object 出来的，就由哪个 new Object 实现
        ICourse javaCourse = new JavaDiscountCourse(96,"java从零开发",3456d);
        JavaDiscountCourse javaDiscountCourse = (JavaDiscountCourse) javaCourse;
        System.out.println("课程id："+javaCourse.getId()+"课程name："+javaCourse.getName()+"课程价格："+javaCourse.getPrice()+"原价是："+javaDiscountCourse.getOriginPrice());
    }
}
